/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package koneksi;
import java.sql.Connection;
import java.sql.DriverManager;

/**
 *
 * @author rosi
 */
public class Koneksi {

//    private String database = "convert";

//    public static Connection open() throws SQLException, FileNotFoundException, IOException {
////        SettingFile set = new SettingFile();
////        String username = set.bacaUser();
////        String password = set.bacaPass();
////        String url = set.bacaUrl();
//        Connection con = null;
//        MysqlDataSource ds = new MysqlDataSource();
//        ds.setURL("jdbc:mysql://localhost:3306/convert");
//        ds.setUser("root");
//        ds.setPassword("1234");
//        con = ds.getConnection();
//        return con;
//    }
//
//    public String getDatabase() {
//        return "use " + database;
//    }
   public static Connection open() {
        String dbname = "jdbc:odbc:coba";
        Connection con = null;
        try {
            Class.forName("oracle.jdbc.driver.OracleDriver");
            con = DriverManager.getConnection(dbname);
//            Statement stat = con.createStatement();
//            System.out.println("Connection OK");
        } catch (Exception e) {
            System.out.println("error: " + e.getMessage());
        }
        return con;
    }
}
